home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 491 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.2 KB  |  54 lines

  1. Path: news.telalink.net!news
  2. From: carl@tashian.com (Carl Tashian)
  3. Newsgroups: comp.lang.c
  4. Subject: Tree database?
  5. Date: Fri, 05 Jan 1996 20:53:14 GMT
  6. Organization: Telalink Corporation, Nashville, TN, USA
  7. Message-ID: <30ed88e4.66565357@news.telalink.net>
  8. NNTP-Posting-Host: carl.tashian.com
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=ISO-8859-1
  11. Content-Transfer-Encoding: 8BIT
  12. X-Newsreader: Forte Agent .99c/16.141
  13.  
  14. I'm looking for a way to make and manage a tree database.. not just a
  15. binary tree, but one with infinite (HD space limited) leaves and
  16. branches.. A good example of what I'm looking for is Yahoo.. how did
  17. they create it? So far, the only thing I can think of is to create a
  18. directory tree based on a plain old binary file...and that's what I've
  19. done, but it doesn't work as well as it could..
  20.  
  21. example:
  22.  
  23. struct file_data {
  24.    int template_type; /* document or siteinfo */
  25.    char title[256]; /* Document title */
  26.    char uri[256]; /* Document URL */
  27.    char desc[512]; /* Description */
  28.    char keys[512]; /* Keywords */
  29.    char author[256]; /* Author handle (e-mail) */
  30.    char category[256]; /* categories */
  31.    time_t created; /* date created */
  32.    time_t expires; /* date to expire */
  33.    long stats; /* bitvector for stats */
  34. };
  35.  
  36. category might have "Business, Internet" in it. If so, an entry is
  37. added to an HTML file in Business/Internet...a category is created
  38. only when an entry exists in that category (there are no entries that
  39. define categories). rather than using the "symlinks" that Yahoo has, I
  40. can put an entry in more than one category ("Business, Internet;
  41. Hobbies, Internet").. but I can't have one category accessed from many
  42. places. although basing this directory tree on a  binary file does
  43. allow for very easy searching, the thing I don't like about it is that
  44. all of the HTML files have to be deleted and rebuilt every time the
  45. database changes ...
  46.  
  47. If I had it all working in real time (generating the categories as
  48. they are required), and pulled all of the entries matching "Business,
  49. Internet" when the user clicked on "Internet" under "Business", It'd
  50. be too slow.. (it would also have to find all categories below
  51. "Business, Internet" and list those on the same page as categories)
  52.  
  53. so.. what's the secret to Yahoo? :)
  54.